/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFramemain.java
 *
 * Created on Dec 2, 2011, 6:29:26 PM
 */
package aptech;

/**
 *
 * @author RUOL
 */
public class JFramemain extends javax.swing.JFrame {

    /** Creates new form JFramemain */
    public JFramemain() {
        initComponents();
        loptrunggian.jfmain=this;
    }
    public void ganquyen(String quyen)
    {
        if(quyen.equals("admin"))
        {
            
        }
        else if(quyen.equals("nhanvien"))
        {
            this.jMenudanhmuc.setVisible(false);
        }
        else if(quyen.equals("giamdoc"))
        {
        this.jMenusanpham_themmoi.setVisible(false);
        this.jMenudanhmuc_danhsach.setVisible(false);
        }
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPanemanhinh = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenudanhmuc = new javax.swing.JMenu();
        jMenudanhmuc_themmoi = new javax.swing.JMenuItem();
        jMenudanhmuc_danhsach = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenusanpham = new javax.swing.JMenu();
        jMenusanpham_themmoi = new javax.swing.JMenuItem();
        Khoadaotao_danhsachkhoa = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu1 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(aptech.AptechApp.class).getContext().getResourceMap(JFramemain.class);
        jDesktopPanemanhinh.setBackground(resourceMap.getColor("jDesktopPanemanhinh.background")); // NOI18N
        jDesktopPanemanhinh.setForeground(resourceMap.getColor("jDesktopPanemanhinh.foreground")); // NOI18N
        jDesktopPanemanhinh.setAlignmentY(600.0F);
        jDesktopPanemanhinh.setName("jDesktopPanemanhinh"); // NOI18N
        getContentPane().add(jDesktopPanemanhinh, java.awt.BorderLayout.CENTER);

        jMenuBar1.setAlignmentY(600.0F);
        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenudanhmuc.setText(resourceMap.getString("jMenudanhmuc.text")); // NOI18N
        jMenudanhmuc.setName("jMenudanhmuc"); // NOI18N

        jMenudanhmuc_themmoi.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jMenudanhmuc_themmoi.setText(resourceMap.getString("jMenudanhmuc_themmoi.text")); // NOI18N
        jMenudanhmuc_themmoi.setName("jMenudanhmuc_themmoi"); // NOI18N
        jMenudanhmuc_themmoi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenudanhmuc_themmoiActionPerformed(evt);
            }
        });
        jMenudanhmuc.add(jMenudanhmuc_themmoi);

        jMenudanhmuc_danhsach.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        jMenudanhmuc_danhsach.setText(resourceMap.getString("jMenudanhmuc_danhsach.text")); // NOI18N
        jMenudanhmuc_danhsach.setName("jMenudanhmuc_danhsach"); // NOI18N
        jMenudanhmuc_danhsach.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenudanhmuc_danhsachActionPerformed(evt);
            }
        });
        jMenudanhmuc.add(jMenudanhmuc_danhsach);

        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenudanhmuc.add(jMenuItem1);

        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenudanhmuc.add(jMenuItem2);

        jMenuBar1.add(jMenudanhmuc);

        jMenusanpham.setText(resourceMap.getString("jMenusanpham.text")); // NOI18N
        jMenusanpham.setName("jMenusanpham"); // NOI18N
        jMenusanpham.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenusanphamActionPerformed(evt);
            }
        });

        jMenusanpham_themmoi.setText(resourceMap.getString("jMenusanpham_themmoi.text")); // NOI18N
        jMenusanpham_themmoi.setName("jMenusanpham_themmoi"); // NOI18N
        jMenusanpham.add(jMenusanpham_themmoi);

        Khoadaotao_danhsachkhoa.setText(resourceMap.getString("Khoadaotao_danhsachkhoa.text")); // NOI18N
        Khoadaotao_danhsachkhoa.setName("Khoadaotao_danhsachkhoa"); // NOI18N
        Khoadaotao_danhsachkhoa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Khoadaotao_danhsachkhoaActionPerformed(evt);
            }
        });
        jMenusanpham.add(Khoadaotao_danhsachkhoa);

        jMenuBar1.add(jMenusanpham);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N
        jMenuBar1.add(jMenu2);

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N
        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenudanhmuc_themmoiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenudanhmuc_themmoiActionPerformed
        ThemSinhVien jftdm=new ThemSinhVien();
        this.jDesktopPanemanhinh.add(jftdm);
        jftdm.setVisible(true);
    }//GEN-LAST:event_jMenudanhmuc_themmoiActionPerformed

    private void jMenusanphamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenusanphamActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenusanphamActionPerformed

    private void Khoadaotao_danhsachkhoaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Khoadaotao_danhsachkhoaActionPerformed
        DanhSachKhoa dsk=new DanhSachKhoa();
        this.jDesktopPanemanhinh.add(dsk);
        dsk.setVisible(true);
    }//GEN-LAST:event_Khoadaotao_danhsachkhoaActionPerformed

    private void jMenudanhmuc_danhsachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenudanhmuc_danhsachActionPerformed
        DanhSachSinhVien dssv=new DanhSachSinhVien();
        this.jDesktopPanemanhinh.add(dssv);
        dssv.setVisible(true);
    }//GEN-LAST:event_jMenudanhmuc_danhsachActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new JFramemain().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem Khoadaotao_danhsachkhoa;
    private javax.swing.JDesktopPane jDesktopPanemanhinh;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenu jMenudanhmuc;
    private javax.swing.JMenuItem jMenudanhmuc_danhsach;
    private javax.swing.JMenuItem jMenudanhmuc_themmoi;
    private javax.swing.JMenu jMenusanpham;
    private javax.swing.JMenuItem jMenusanpham_themmoi;
    // End of variables declaration//GEN-END:variables
}
